package cn.stacey.day13;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
	
	public static void main(String[] args) {
		try {
			//host主机 
			Socket socket=new Socket("127.0.0.1",6666);
				//客户端发出消息
			OutputStream out=socket.getOutputStream();
			out.write('C');
				//客户端接收消息
			InputStream in=socket.getInputStream();
			System.out.println(in.read());

		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	
}
